<?php
class CategoryModel extends Model{
	/**
	 * 取得该类别下的所有子类
	 */
	/*
	function getchildren($id=0){
		static $children=array();
		$data=$this->where(array('pid'=>$id))->select();
		foreach ($data as $k => $v) {
			$children[]=$v['id'];
			$this->getchildren($v['id']);
		}
		return $children;		
	}
	/**
	 * 取得该类所有父类
	 */
	/*
	function getparent($id=0){
		static $parent=array();
		$data=$this->where(array('id'=>$id))->find();
		$parent[]=$data['id'];
		$this->getparent($data['pid']);
		return $parent;		
	}
	/**
	 * 获取分类树
	 */	

}
?>